// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import echarts from 'echarts'

import MyFooter from "@/components/myfooter";
import MyCell from "@/components/mycell";
import { getCookie } from '@/assets/js/cookie.js'


Vue.config.productionTip = false

Vue.use(MintUI)

Vue.component('my-footer', MyFooter)
Vue.component('my-cell', MyCell)

router.beforeEach((to, from, next) => {
    if(to.meta.requiresAuth && !getCookie("login_key")) {
        next({path: '/login'})
    } else {
        next()
    }
})

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
